<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>药品澄清（生产企业端）</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <!-- 操作列超过三条使用 更多弹窗 -->
    <div class="box box-primary" id="more" style="width:70px;height:35px;background-color:#2C3B41;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#2C3B41;">
            <div class="box-body home-message" id="moreOp">
            </div>
    </div>

    <section class="content-header">
        <h1>药品澄清</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">药品招标管理</a></li>
            <li class="active"><a href="#">投标药品管理</a></li>
            <li class="active"><a href="#">药品澄清</a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                     <label>药品编码：</label>
                        <input class="form-control" id="drugcode" name="drugcode" type="text" placeholder="药品编码" />
                    </div>
                     <div class="form-group form-group-xs">
                        <label>通用名：</label>
                        <input class="form-control" id="qualityspecName" name="qualityspecName" type="text" placeholder="通用名" />
                    </div>
                     
                    <div class="form-group form-group-xs">
                        <label>生产企业：</label>
                        <input class="form-control"  id="prodCompName" name="prodCompName" type="text" placeholder="生产企业" />
                 
                   </div>
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"> 查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class=" box box-warning bottongroup">
            <a href="${ctx}/prodDrug/toDrugProjectList.html" class="btn btn-default btn-sm">返&nbsp;&nbsp;回</a>
        </div>

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
    <script type="text/javascript">
        
        $(function () {
            
            $("#gridlist").jqGrid({
                url: "${ctx}/prodDrug/getProdDrugList.html",
                mtype: "POST",
                datatype: "json",
                postData: { "projId" : "${projId}" },
                autowidth: true,
                height: 270,
                colNames: ['projId', 'prodId','qualityspecId','药品编码',  '通用名', '剂型', '规格', '转换系数', '单位','材质', '生产企业','操作'],
                colModel: [
                    { name: 'projId', width: 120 ,hidden:true, align:"center",sortable: false},
                    { name: 'prodId', width: 120 ,hidden:true, align:"center",sortable: false},
                    { name: 'qualityspecId',hidden:true, width: 120 ,key:true, align:"center",sortable: false},
                    { name: 'drugCode', width: 100 , align:"center",sortable: false,key:true},
                    { name: 'qualityspecName', width: 140 , align:"left" ,sortable: false,key:true},
                    { name: 'form', width: 80 , align:"center" ,sortable: false,key:true},
                    { name: 'spec', width: 80 , align:"left" ,sortable: false,key:true},
                    { name: 'factor', width: 80 , align:"center" ,sortable: false,key:true},
                    { name: 'unit', width: 40 , align:"center" ,sortable: false,key:true},
                    { name: 'materialName', width: 80 , align:"center" ,sortable: false,key:true},
                    { name: 'prodCompName', width: 180 , align:"left",key:true,sortable: false,
                        formatter:function(cellvalue, options, row){
                            return '<a href="javascript:showCompInfo(\''+ row.prodCompId +'\');">'+cellvalue+'</a>';
                        }
                    },
                    { name: 'operate', width: 80 , align:"center"sortable: false,
                        formatter:function(cellvalue, options, row){
                            return '<a href="${ctx}/prodDrug/toProdDrugComlain.html">澄清</a>';
                        }
                    }
                ],
                rowNum: 20,
                rowList: [10,20,50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: true, 
                viewrecords: true,
                caption: "药品列表",
                jsonReader: {
                    repeatitems: false,
                    id: "prodId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");  
            
        });
        

        //查询
        function gridSerch() {
            var drugcode = $.trim( $("#drugcode").val());
            var qualityspecName = $.trim( $("#qualityspecName").val());
            var prodCompName = $.trim( $("#prodCompName").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{"drugCode":drugcode,
                        "qualityspecName":qualityspecName,
                        "prodCompName":prodCompName}
            }).trigger("reloadGrid"); //重新载入  
        }
        
        
        //澄清
       /*  function submitProdDrugList(prodId) {
           var params = [];
          params.push({"prodId":prodId,"projId":"${projId}"});
          $.HN.message.confirm("确定澄清吗？", '', '').on(function (e) {
                if (e) {
          $.post("${ctx}/prodDrug/submitProdDrugList.html", {
              "array" : json.jsonToString(params)
          }, function(result) {
              if (result.success) {
                  $.HN.message.alert("操作成功！", "消息", "success");
              } else {
                  $.HN.message.alert("操作失败！", "消息", "error");
              }
          }, "json");
                }
            }); 
       
      }   */
        
        
        
        //生产企业弹窗
        function showCompInfo(prodCompId) {
            $.HN.dialog.open({
                "id": "showCompInfo", 
                "title": "生产企业信息", 
                "url": "${ctx}/stdCompinfo/toStdCompinfoDetail.html?compId="+prodCompId,
                "data": {}, 
                "width": 800, 
                "height": 400, 
                "closefunc":function() {
                    
                }
            });
        }
        
        
 
    </script>
</body>
</html>